
import 'package:flutter_bloc_todo/model/todo_model.dart';
import 'package:hive/hive.dart';

class ToDoModelAdapter extends TypeAdapter<ToDoModel>{
  @override
  ToDoModel read(BinaryReader reader) {
    return ToDoModel(
      title: reader.read(),
      content:reader.read(),
      updateAt:reader.read(),
      leave0l: reader.read()
    );
  }

  @override
  final int typeId =0;

  @override
  void write(BinaryWriter writer, ToDoModel obj) {
    writer.write(obj.title);
    writer.write(obj.content);
    writer.write(obj.updateAt);
    writer.write(obj.leave0l);
  }

}